package com.liuym.common.dubbo.classes.api;

import com.liuym.common.dubbo.classes.dto.ClassScoreDTO;
import com.liuym.common.exception.ClassException;

import java.util.Date;
import java.util.List;
import java.util.Map;


/**
 * @author Liuym
 * @date 2018/12/12 17:33
 * @describe：
 */
public interface ClassScoreDubboService {
    /**
     * 添加分数
     *
     * @param userName
     * @param classScoreDTO
     * @return
     * @throws ClassException
     */
    boolean addClassScore(String classScoreTableName, String userName, ClassScoreDTO classScoreDTO) throws ClassException;

    /**
     * 批量添加班级分数信息
     *
     * @param userName
     * @param classScoreDTOList
     * @return
     * @throws ClassException
     */
    Map<String, Object> addClassScoreList(String classScoreTableName, String userName, List<ClassScoreDTO> classScoreDTOList) throws ClassException;

    /**
     * 根据学号获得分数信息
     *
     * @param classNumber
     * @return
     */
    List<ClassScoreDTO> getClassScoreByClassNumber(String classScoreTableName, long classNumber) throws ClassException;

    /**
     * 根据id获得分数信息
     *
     * @param id
     * @return
     */
    ClassScoreDTO getClassScoreById(String classScoreTableName, int id) throws ClassException;

    /**
     * 更新分数信息
     *
     * @param classScoreDTO
     * @return
     */
    void updateClassScore(String classScoreTableName, ClassScoreDTO classScoreDTO,Integer oldScore) throws ClassException;

    /**
     * 删除分数
     *
     * @param id
     * @return
     */
    void deleteClassScore(String classScoreTableName, int id) throws ClassException;

    /**
     * 获得一定时间内的分数信息
     *
     * @param startTime
     * @param endTime
     * @return
     */
    List<ClassScoreDTO> getClassScoreByTime(String classScoreTableName, Date startTime, Date endTime) throws ClassException;

    /**
     * 获得某个管理员操作的分数信息
     *
     * @param userName
     * @param startTime
     * @param endTime
     * @return
     */
    List<ClassScoreDTO> getClassScoreByAdmin(String classScoreTableName, String userName, Date startTime, Date endTime) throws ClassException;

    /**
     * 创建表
     *
     * @param classScoreTableName
     * @return
     */
    int addClassScoreTable(String classScoreTableName) throws ClassException;
}
